package com.zhu.wx.strategy;

import com.zhu.wx.entity.ResMsg;

/**
 * 策略代理
 * 作用：统一调用
 */
public class ResStrategyContext {
    /**
     * 封装了策略对象
     */
    private WxResStrategy strategy = null;

    public ResStrategyContext(WxResStrategy strategy) {
        this.strategy = strategy;
    }

    /**
     * 实现了策略可以互换的功能
     *
     * @param strategy
     */
    public void setStrategy(WxResStrategy strategy) {
        this.strategy = strategy;
    }

    public String execute(ResMsg resMsg) {
        return this.strategy.execute(resMsg);
    }
}
